package com.hjxr.sysadmin.zsj.service.impl;

import java.util.Date;
import java.util.List;

import com.hjxr.sysadmin.zsj.domain.ZIndustry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hjxr.sysadmin.zsj.mapper.ParkMapper;
import com.hjxr.sysadmin.zsj.domain.Park;
import com.hjxr.sysadmin.zsj.service.IParkService;

/**
 * 园区信息Service业务层处理
 *
 * @author zc
 * @date 2021-03-22
 */
@Service
public class ParkServiceImpl implements IParkService
{
    @Autowired
    private ParkMapper parkMapper;

    /**
     * 查询园区信息
     *
     * @param parkId 园区信息ID
     * @return 园区信息
     */
    @Override
    public Park selectParkById(Long parkId)
    {
        return parkMapper.selectParkById(parkId);
    }

    /**
     * 查询园区信息列表
     *
     * @param park 园区信息
     * @return 园区信息
     */
    @Override
    public List<Park> selectParkList(Park park)
    {
        return parkMapper.selectParkList(park);
    }

    /**
     * 新增园区信息
     *
     * @param park 园区信息
     * @return 结果
     */
    @Override
    public int insertPark(Park park)
    {
        park.setModifiedTime(new Date());
        return parkMapper.insertPark(park);
    }

    /**
     * 修改园区信息
     *
     * @param park 园区信息
     * @return 结果
     */
    @Override
    public int updatePark(Park park)
    {
        park.setModifiedTime(new Date());
        return parkMapper.updatePark(park);
    }

    /**
     * 批量删除园区信息
     *
     * @param parkIds 需要删除的园区信息ID
     * @return 结果
     */
    @Override
    public int deleteParkByIds(Long[] parkIds)
    {
        return parkMapper.deleteParkByIds(parkIds);
    }

    /**
     * 删除园区信息信息
     *
     * @param parkId 园区信息ID
     * @return 结果
     */
    @Override
    public int deleteParkById(Long parkId)
    {
        return parkMapper.deleteParkById(parkId);
    }

    /**
     * 查询园区主导产业信息
     * @param parkId
     * @return
     */
    @Override
    public ZIndustry selectIndustryById(Long parkId) {
        ZIndustry zIndustry = parkMapper.selectIndustryById(parkId);
        return zIndustry;
    }

    /**
     * 新增园区主导产业信息
     * @param zIndustry
     * @return
     */
    @Override
    public int insertIndustry(ZIndustry zIndustry) {
        zIndustry.setModifiedTime(new Date());
        return parkMapper.insertIndustry(zIndustry);
    }

    /**
     * 修改园区主导产业信息
     * @param zIndustry
     * @return
     */
    @Override
    public int updateIndustry(ZIndustry zIndustry) {
        zIndustry.setModifiedTime(new Date());
        return parkMapper.updateIndustry(zIndustry);
    }

    @Override
    public List<Park> selectParkListBoundary(Park park) {
        return parkMapper.selectParkListBoundary(park);
    }
}
